See https://psyarxiv.com/5ygtc/

Participants

library(tidyverse)
library(easystats)
library(patchwork)
library(lavaan)
library(ggraph)
library(tidySEM)

df <- haven::read_sav("data/Data_Study 1.sav") |> 
  mutate_all(as.numeric) |> 
  filter(!is.na(exclude) & exclude == 0) |> 
  mutate(gen = as.character(ifelse(gen == 1, "Male", ifelse(gen == 2, "Female", "Other"))))

data <- df |> 
  select(matches("npi[[:digit:]]"),
         matches("narq[[:digit:]]"),
         matches("pni[[:digit:]]"),
         matches("hn[[:digit:]]"),
         matches("dt[[:digit:]]"),
         matches("dsm[[:digit:]]")) |> 
  select(-ends_with("r")) |> 
  normalize(verbose=FALSE) |> 
  mutate(across(everything(), as.numeric))


# names(df)
# data
# summary(data)

paste0(
  "Data from the [study 1](https://osf.io/gp6a4/) (Weidmann et al.), downloaded from OSF, included ",
  report::report_participants(df, age = "age", gender = "gen", race = NA),
  "."
)

[1] “Data from the study 1 (Weidmann et al.), downloaded from OSF, included 5736 participants (Mean age = 21.3, SD = 6.9, range: [18, 75], 2.6% missing; Gender: 64.1% women, 32.5% men, 0.40% non-binary, 3.07% missing).”

Distributions

plot_hist <- function(data, x) {
  data |> 
    select(starts_with(x)) |> 
    pivot_longer(everything()) |> 
    filter(!is.na(value)) |> 
    ggplot(aes(x = value)) +
    geom_histogram(aes(fill=name), alpha = 0.3, position = "dodge") +
    theme(legend.position = "none")
}

patchwork::wrap_plots(
  plot_hist(data, "npi"),
  plot_hist(data, "narq"),
  plot_hist(data, "pni"),
  plot_hist(data, "hn"),
  plot_hist(data, "dt"),
  plot_hist(data, "dsm")
)

Distributions

plot_hist <- function(data, x) {
  data |> 
    select(starts_with(x)) |> 
    pivot_longer(everything()) |> 
    filter(!is.na(value)) |> 
    ggplot(aes(x = value)) +
    geom_histogram(aes(fill=name), alpha = 0.3, position = "dodge") +
    theme(legend.position = "none")
}

patchwork::wrap_plots(
  plot_hist(data, "npi"),
  plot_hist(data, "narq"),
  plot_hist(data, "pni"),
  plot_hist(data, "hn"),
  plot_hist(data, "dt"),
  plot_hist(data, "dsm")
)

Correlation

# r <- cor(data, use = "pairwise.complete.obs")
r <- correlation(data) 

r |> 
  arrange(desc(abs(r))) |> 
  head()
## # Correlation Matrix (pearson-method)
## 
## Parameter1 | Parameter2 |    r |       95% CI |     t |   df |         p
## ------------------------------------------------------------------------
## narq6      |      narq9 | 0.70 | [0.69, 0.71] | 67.89 | 4803 | < .001***
## pni8       |      pni16 | 0.70 | [0.68, 0.71] | 61.86 | 4021 | < .001***
## pni8       |      pni40 | 0.65 | [0.63, 0.67] | 53.91 | 4027 | < .001***
## pni30      |      pni36 | 0.65 | [0.63, 0.66] | 53.94 | 4032 | < .001***
## pni31      |      pni45 | 0.65 | [0.63, 0.66] | 53.84 | 4022 | < .001***
## narq11     |      pni29 | 0.64 | [0.62, 0.66] | 50.53 | 3625 | < .001***
## 
## p-value adjustment method: Holm (1979)
## Observations: 3627-4805

EFA

n <- parameters::n_factors(data, n_max = 15)

n
## # Method Agreement Procedure:
## 
## The choice of 1 dimensions is supported by 2 (28.57%) methods out of 7 (Acceleration factor, VSS complexity 1).

plot(n)

efa1 <- parameters::factor_analysis(data, n=1, sort = TRUE)

efa3 <- parameters::factor_analysis(data, n=3, rotation = "oblimin", sort = TRUE)

efa3_varimax <- parameters::factor_analysis(data, n=3, rotation = "varimax", sort = TRUE)

efa3_equamax <- parameters::factor_analysis(data, n=3, rotation = "equamax", sort = TRUE)

efa3_bentlerQ <- parameters::factor_analysis(data, n=3, rotation = "bentlerQ", sort = TRUE)

wrap_plots(plot(efa3), plot(efa3_varimax), plot(efa3_equamax), plot(efa3_bentlerQ))

CFA

cfa1 <-  parameters::efa_to_cfa(efa1, sort=TRUE, max_per_dimension=3) |> 
  lavaan::cfa(data=data)

cfa3 <- parameters::efa_to_cfa(efa3, threshold = "max", sort=TRUE, max_per_dimension=3) |> 
  lavaan::cfa(data=data)

cfa3b <- parameters::efa_to_cfa(efa3_varimax, threshold = "max", sort=TRUE, max_per_dimension=3) |> 
  lavaan::cfa(data=data)

cfa3c <- parameters::efa_to_cfa(efa3_equamax, threshold = "max", sort=TRUE, max_per_dimension=3) |> 
  lavaan::cfa(data=data)

cfa3d <- parameters::efa_to_cfa(efa3_bentlerQ, threshold = "max", sort=TRUE, max_per_dimension=3) |> 
  lavaan::cfa(data=data)

anova(cfa1, cfa3, cfa3b, cfa3c, cfa3d)
## Chi-Squared Difference Test
## 
##       Df   AIC   BIC Chisq Chisq diff Df diff Pr(>Chisq)    
## cfa1   0  -374  -336     0                                  
## cfa3  24 -1701 -1578   363        363      24     <2e-16 ***
## cfa3b 24 -4562 -4432   650        288       0               
## cfa3c 24 -4075 -3946   678         28       0               
## cfa3d 24 -1701 -1578   363       -316       0               
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

parameters::parameters(cfa3b) |> 
  display() 
# Loading
Link Coefficient SE 95% CI z p
MR1 =~ pni16 1.00 0.00 (1.00, 1.00) < .001
MR1 =~ pni8 1.01 0.02 (0.97, 1.05) 48.05 < .001
MR1 =~ pni36 0.91 0.02 (0.87, 0.95) 44.27 < .001
MR3 =~ narq17 1.00 0.00 (1.00, 1.00) < .001
MR3 =~ narq12 0.70 0.03 (0.65, 0.75) 26.98 < .001
MR3 =~ narq13 0.95 0.03 (0.89, 1.02) 28.87 < .001
MR2 =~ narq1 1.00 0.00 (1.00, 1.00) < .001
MR2 =~ narq15 1.48 0.06 (1.37, 1.59) 26.78 < .001
MR2 =~ narq3 1.29 0.05 (1.20, 1.38) 27.19 < .001
# Correlation
Link Coefficient SE 95% CI z p
MR1 ~~ MR3 0.01 9.73e-04 (0.01, 0.02) 14.30 < .001
MR1 ~~ MR2 2.72e-03 7.16e-04 (1.32e-03, 4.13e-03) 3.80 < .001
MR3 ~~ MR2 7.80e-03 6.52e-04 (6.52e-03, 9.08e-03) 11.96 < .001

Items

# chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/http://www.antoniocasella.eu/archipsy/Wright_2010.pdf
# chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/http://www.persoc.net/persoc/uploads/Toolbox/NARQ_English.pdf
add_labels <- function(x) {
  case_when(x == "pni8" ~ "When people don’t notice me, I start to feel bad about myself.",
            x == "pni16" ~ "When others don’t notice me, I start to feel worthless.",
            x == "pni18" ~ "I typically get very angry when I’m unable to get what I want from others.",
            x == "pni30" ~ "It’s hard to feel good about myself unless I know other people admire me.",
            x == "pni32" ~ "I am preoccupied with thoughts and concerns that most people are not interested in me.",
            x == "pni36" ~ "It’s hard for me to feel good about myself unless I know other people like me.",
            x == "pni40" ~ "I am disappointed when people don’t notice me.",
            x == "pni47" ~ "When others don’t respond to me the way that I would like them to, it is hard for me to still feel ok with myself.",
            x == "narq1" ~ "I am great.",
            x == "narq3" ~ "I show others how special I am.",
            x == "narq7" ~ "Most of the time I am able to draw people’s attention to myself in conversations.",
            x == "narq8" ~ "I deserve to be seen as a great personality.",
            x == "narq9" ~ "I want my rivals to fail.",
            x == "narq10" ~ "I enjoy it when another person is inferior to me.",
            x == "narq12" ~ "I can barely stand it if another person is at the center of events.",
            x == "narq13" ~ "Most people won’t achieve anything.",
            x == "narq14" ~ "Other people are worth nothing.",
            x == "narq15" ~ "Being a very special person gives me a lot of strength.",
            x == "narq16" ~ "I manage to be the center of attention with my outstanding contributions.",
            x == "narq17" ~ "Most people are somehow losers.",
            x == "hn10" ~ "I am secretly 'put out' or annoyed when other people come to me with their troubles, asking me for my time and sympathy.",
            x == "dt4" ~ "I tend to expect special favors from others.",
            # TODO
            TRUE ~ x)
}


parameters(cfa3b, standardize=TRUE, component="loading") |> 
  arrange(To, desc(abs(Coefficient))) |>
  mutate(Dimension = To, Item = From, Label = add_labels(From),
         Dimension = case_when(Dimension == "MR1" ~ "Demonstration", 
                               Dimension == "MR2" ~ "Grandeur", 
                               TRUE ~ "Antagonism")) |> 
  format_table() |> 
  select(Dimension, Item, Label, Coefficient, CI) |> 
  display() 
Dimension Item Label Coefficient CI
Demonstration pni16 When others don’t notice me, I start to feel worthless. 0.81 [0.80, 0.83]
Demonstration pni8 When people don’t notice me, I start to feel bad about myself. 0.81 [0.79, 0.83]
Demonstration pni30 It’s hard to feel good about myself unless I know other people admire me. 0.78 [0.76, 0.80]
Demonstration pni36 It’s hard for me to feel good about myself unless I know other people like me. 0.77 [0.75, 0.79]
Demonstration pni47 When others don’t respond to me the way that I would like them to, it is hard for me to still feel ok with myself. 0.68 [0.66, 0.70]
Grandeur narq3 I show others how special I am. 0.73 [0.70, 0.75]
Grandeur narq15 Being a very special person gives me a lot of strength. 0.73 [0.70, 0.75]
Grandeur narq8 I deserve to be seen as a great personality. 0.65 [0.63, 0.68]
Grandeur narq16 I manage to be the center of attention with my outstanding contributions. 0.62 [0.59, 0.65]
Grandeur narq1 I am great. 0.59 [0.56, 0.62]
Antagonism narq17 Most people are somehow losers. 0.70 [0.67, 0.72]
Antagonism narq12 I can barely stand it if another person is at the center of events. 0.67 [0.64, 0.70]
Antagonism narq10 I enjoy it when another person is inferior to me. 0.67 [0.64, 0.70]
Antagonism narq13 Most people won’t achieve anything. 0.63 [0.60, 0.66]
Antagonism hn10 I am secretly ‘put out’ or annoyed when other people come to me with their troubles, asking me for my time and sympathy. 0.48 [0.45, 0.52]

Long Version

cfa1 <-  parameters::efa_to_cfa(efa1, sort=TRUE, max_per_dimension=6) |> 
  lavaan::cfa(data=data)

cfa3 <- parameters::efa_to_cfa(efa3, threshold = "max", sort=TRUE, max_per_dimension=6) |> 
  lavaan::cfa(data=data)

cfa3b <- parameters::efa_to_cfa(efa3_varimax, threshold = "max", sort=TRUE, max_per_dimension=6) |> 
  lavaan::cfa(data=data)

cfa3c <- parameters::efa_to_cfa(efa3_equamax, threshold = "max", sort=TRUE, max_per_dimension=6) |> 
  lavaan::cfa(data=data)

cfa3d <- parameters::efa_to_cfa(efa3_bentlerQ, threshold = "max", sort=TRUE, max_per_dimension=6) |> 
  lavaan::cfa(data=data)

anova(cfa1, cfa3, cfa3b, cfa3c, cfa3d)
## Chi-Squared Difference Test
## 
##        Df   AIC   BIC Chisq Chisq diff Df diff Pr(>Chisq)    
## cfa1    9 -2003 -1928   204                                  
## cfa3  132 -7607 -7379  1554       1350     123     <2e-16 ***
## cfa3b 132 -8600 -8371  1686        132       0               
## cfa3c 132 -7642 -7413  1605        -81       0               
## cfa3d 132 -7607 -7379  1554        -51       0               
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

parameters::parameters(cfa3b) |> 
  display() 
# Loading
Link Coefficient SE 95% CI z p
MR1 =~ pni16 1.00 0.00 (1.00, 1.00) < .001
MR1 =~ pni8 1.02 0.02 (0.98, 1.06) 47.73 < .001
MR1 =~ pni36 0.96 0.02 (0.92, 1.01) 42.28 < .001
MR1 =~ pni30 0.95 0.02 (0.91, 0.99) 43.44 < .001
MR1 =~ pni47 0.82 0.02 (0.78, 0.86) 36.44 < .001
MR1 =~ pni40 0.87 0.02 (0.83, 0.91) 41.35 < .001
MR3 =~ narq17 1.00 0.00 (1.00, 1.00) < .001
MR3 =~ narq12 0.92 0.03 (0.85, 0.98) 28.71 < .001
MR3 =~ narq13 0.98 0.04 (0.91, 1.05) 27.49 < .001
MR3 =~ hn10 0.72 0.03 (0.66, 0.79) 20.95 < .001
MR3 =~ narq10 1.10 0.04 (1.03, 1.18) 29.58 < .001
MR3 =~ narq9 1.11 0.04 (1.04, 1.19) 28.34 < .001
MR2 =~ narq1 1.00 0.00 (1.00, 1.00) < .001
MR2 =~ narq15 1.39 0.06 (1.28, 1.50) 25.26 < .001
MR2 =~ narq3 1.35 0.05 (1.25, 1.45) 25.89 < .001
MR2 =~ narq8 1.27 0.05 (1.16, 1.37) 24.12 < .001
MR2 =~ narq16 1.18 0.05 (1.08, 1.27) 24.39 < .001
MR2 =~ narq7 1.12 0.05 (1.02, 1.22) 22.72 < .001
# Correlation
Link Coefficient SE 95% CI z p
MR1 ~~ MR3 0.02 1.00e-03 (0.01, 0.02) 16.21 < .001
MR1 ~~ MR2 5.99e-03 7.80e-04 (4.46e-03, 7.52e-03) 7.68 < .001
MR3 ~~ MR2 0.01 6.95e-04 (8.92e-03, 0.01) 14.80 < .001


parameters(cfa3b, standardize=TRUE, component="loading") |> 
  arrange(To, desc(abs(Coefficient))) |>
  mutate(Dimension = To, Item = From, Label = add_labels(From),
         Dimension = case_when(Dimension == "MR1" ~ "Demonstration", 
                               Dimension == "MR2" ~ "Grandeur", 
                               TRUE ~ "Antagonism")) |> 
  format_table() |> 
  select(Dimension, Item, Label, Coefficient, CI) |> 
  display() 
Dimension Item Label Coefficient CI
Demonstration pni8 When people don’t notice me, I start to feel bad about myself. 0.83 [0.81, 0.84]
Demonstration pni16 When others don’t notice me, I start to feel worthless. 0.82 [0.80, 0.83]
Demonstration pni30 It’s hard to feel good about myself unless I know other people admire me. 0.77 [0.75, 0.79]
Demonstration pni36 It’s hard for me to feel good about myself unless I know other people like me. 0.76 [0.74, 0.77]
Demonstration pni40 I am disappointed when people don’t notice me. 0.74 [0.72, 0.76]
Demonstration pni47 When others don’t respond to me the way that I would like them to, it is hard for me to still feel ok with myself. 0.67 [0.65, 0.70]
Grandeur narq3 I show others how special I am. 0.73 [0.71, 0.75]
Grandeur narq15 Being a very special person gives me a lot of strength. 0.70 [0.67, 0.72]
Grandeur narq16 I manage to be the center of attention with my outstanding contributions. 0.66 [0.63, 0.69]
Grandeur narq8 I deserve to be seen as a great personality. 0.65 [0.62, 0.67]
Grandeur narq7 Most of the time I am able to draw people’s attention to myself in conversations. 0.59 [0.56, 0.62]
Grandeur narq1 I am great. 0.57 [0.53, 0.60]
Antagonism narq10 I enjoy it when another person is inferior to me. 0.69 [0.67, 0.72]
Antagonism narq17 Most people are somehow losers. 0.69 [0.66, 0.71]
Antagonism narq12 I can barely stand it if another person is at the center of events. 0.67 [0.64, 0.69]
Antagonism narq9 I want my rivals to fail. 0.66 [0.63, 0.68]
Antagonism narq13 Most people won’t achieve anything. 0.63 [0.60, 0.66]
Antagonism hn10 I am secretly ‘put out’ or annoyed when other people come to me with their troubles, asking me for my time and sympathy. 0.47 [0.43, 0.50]